package com.ctgu.chatapp.model.pojo

import androidx.lifecycle.MutableLiveData
import androidx.room.Entity
import androidx.room.Ignore
import androidx.room.Index
import androidx.room.PrimaryKey

@Entity(indices = [Index(value = arrayOf("selfID", "friendID"))])
data class RecordNew(
    @PrimaryKey
    var id: Long?,
    var snowFlower: Long,
    val selfID: Long,
    val friendID: Long,
    val message: Int,
    val context: String,
    val date: Long,
    val fromSelf: Boolean = false
) {
    @Ignore
    constructor(
        snowFlower: Long,
        selfID: Long,
        friendID: Long,
        message: Int,
        context: String,
        date: Long,
        fromSelf: Boolean
    ) : this(null, snowFlower, selfID, friendID, message, context, date, fromSelf)

    @Ignore
    val state = MutableLiveData(1)

    @Ignore
    constructor(
        snowFlower: Long, selfID: Long, friendID: Long, message: Int, context: String, date: Long
    ) : this(null, snowFlower, selfID, friendID, message, context, date, false)
}
